<div class="jipiao pdt10 pdl5">
	<?php $form = $this->beginWidget('CActiveForm', array(
			'method' => 'get',
			'htmlOptions' => array(
				'id' => 'ticket-form',
			),
			'action' => Yii::app()->createUrl('provide/channel/ticketList'),
		))?>
	<table class='form-tb no-border fc_666 largespacing'>
		<tr>
			<th>航程类型：</th>
			<td><label><input type="radio" name="manner" id="bh-hchlx-radio-jj" value="oneWay" checked/> 单程</label>　
			<label><input type="radio" name="manner" id="bh-hchlx-radio-jj" value="return" /> 往返</label> </td>
		</tr>
		<tr>
			<th>出发城市：</th>
			<td>
				<?php LyscHtml::citySelector($form, $model, 'departure_city',array('id'=>'departure-city','init-value' => '请输入出发城市',))?>
				<?php echo $form->hiddenField($returnModel,'landing_city',array('id'=>'return-landing-city'))?>
			</td>
		</tr>
		<tr>
			<th>到达城市：</th>
			<td>
				<?php LyscHtml::citySelector($form, $model, 'landing_city',array('id'=>'landing-city','init-value' => '请输入到达城市',))?>
				<?php echo $form->hiddenField($returnModel,'departure_city',array('id'=>'return-departure-city'))?>
			</td>
		</tr>
		<tr>
			<th>出发日期：</th>
			<td><?php $this->widget('coms.ui.DataPicker', array(
				'model' => $model,
				'attribute' => 'departure_time',
				'htmlOptions' => array(
					'class' => 'bh-ydxx-input-jj',
					'value' => date('Y-m-d',strtotime('+1day'))
				),
				'options' => array('minDate'=>'%y-%M-%d')
			));?></td>
		</tr>
		<tr id='return-time' style='display:none'>
			<th>返回日期：</th>
			<td><?php $this->widget('coms.ui.DataPicker', array(
				'model' => $returnModel,
				'attribute' => 'departure_time',
				'htmlOptions' => array(
					'class' => 'bh-ydxx-input-jj',
					'value' => date('Y-m-d',strtotime('+2day'))
				),
				'options' => array('minDate'=>'%y-%M-%d')
			));?></td>
		</tr>
	</table>
	<div class="bh-mtop15">
		<input id='submit-tqs' type="submit" name="bh-ydchaxun-jj" class="bh-ydchaxun-jj bh-mtop5 bh-mL_23" value="查询" />
		<div align=center class='lh-38 hide' id='submit-hint-tqs'>请稍候...</div>	
	</div>
	<?php $this->endWidget()?>
</div>
<script>
//bindTextInit($('#departure-city'),$('#<?php echo $form->id?>'));
//bindTextInit($('#landing-city'),$('#<?php echo $form->id?>'));
$(':radio[name=manner]').live('click',function() {
	if($(this).val() == 'return') {
		$('#return-time').show();
	} else {
		$('#return-time').hide();
	}
});
$('#ticket-form').live('submit',function() {
	$('#return-landing-city').val($('#hide_departure-city').val());
	$('#return-departure-city').val($('#hide_landing-city').val());
});

$('#submit-tqs').click(function() {
	var btn = $(this),
		btnHint = $('#submit-hint-tqs');
	btn.hide();
	btnHint.show();
	$.citySelector.get('departure-city').checkValue(function() {
		$.citySelector.get('landing-city').checkValue(function() {
			$('#ticket-form').submit();
		}, function() {
			alert("您输入的城市无效！");
			btn.show();
			btnHint.hide();
		});
	}, function() {
		alert("您输入的城市无效！");
		btn.show();
		btnHint.hide();
	});
	return false;
});
</script>